# Contributor: Milan P. Stanić <mps@arvanta.net>
# Maintainer: Milan P. Stanić <mps@arvanta.net>
pkgname=m1n1
pkgver=1.0.2
_artwork_commitid=35626c31f5c5a8a884aaff93f864795026495742
pkgrel=0
pkgdesc="bootloader and experimentation playground for Apple Silicon"
url="https://github.com/AsahiLinux/m1n1"
arch="aarch64"
license="MIT"
options="!check" # no tests
makedepends="llvm bash imagemagick dtc"
source="m1n1-$pkgver.tar.gz::https://github.com/AsahiLinux/m1n1/archive/refs/tags/v$pkgver.tar.gz
	artwork-$pkgver.tar.gz::https://github.com/AsahiLinux/artwork/archive/$_artwork_commitid.tar.gz"

prepare() {
	default_prepare
	rmdir artwork
	tar xf "$srcdir/"artwork-$pkgver.tar.gz
	mv artwork-$_artwork_commitid artwork
}

build() {
	make ARCH=
}

package() {
	mkdir -p "$pkgdir"/usr/share/m1n1
	install -p -Dm644 "$builddir"/build/m1n1.bin $pkgdir/usr/share/m1n1/
	install -p -Dm644 "$builddir"/build/m1n1.macho $pkgdir/usr/share/m1n1/
}

sha512sums="
258a4fe69729c38bee6ae2032c5893172c53406551c546a7976283fed9dfabaa9531749d4dd7f93393cf5f9255e4db48dd3e00f6561bea16db76907d85112019  m1n1-1.0.2.tar.gz
db83c018636d5148a2d7753fc6d5b7343684bc255b93cc3a6f08cf416ddab1d6ce4290b4a5692c30d1f8258db43d261598e45ebfef0066c632a00d7b53ea7881  artwork-1.0.2.tar.gz
"
